<?php

namespace App\Requests\Api\DailyRecord;

use Illuminate\Foundation\Http\FormRequest;

/**
 * 新增字段校验
 * Class StoreRequest
 * @package App\Requests\Api\DailyRecord
 */
class StoreRequest extends FormRequest {
    public function authorize() {
        return true;
    }

    public function rules() {
        return [
            'school_id'   => 'required|integer',
            'course_id'   => 'required|integer',
            'level_id'    => 'required|integer',
            'student_id'  => 'required|array',
            'teacher_id'  => 'required|integer',
            'time_day'    => 'required|array',
            'begin_clock' => 'required',
            'end_clock'   => 'required',
        ];
    }

    public function messages() {
        return [
            'school_id.required'   => 'school_id 必须',
            'school_id.integer'    => 'school_id 必须 integer',
            'level_id.required'    => 'level_id 必须',
            'level_id.integer'     => 'level_id 必须 integer',
            'course_id.required'   => 'course_id 必须',
            'course_id.integer'    => 'course_id 必须 integer',
            'student_id.required'  => 'student_id 必须',
            'student_id.array'     => 'student_id 必须 array',
            'teacher_id.required'  => 'teacher_id 必须',
            'teacher_id.array'     => 'teacher_id 必须 array',
            'time_day.required'    => 'time_day 必须',
            'time_day.array'       => 'time_day 必须 array',
            'begin_clock.required' => 'begin_clock 必须',
            'end_clock.required'   => 'end_clock 必须',
        ];
    }
}